<template>
	<view>
		<view class="loading" v-if="loading">
			<view class="avatar"></view>
			<view class="loader">
			</view>
		</view>
		<view class="header" v-if="header">
			// #ifdef MP-WEIXIN
			<rui-pages-header></rui-pages-header>
			// #endif
		</view>
		<view class="container">
			<slot></slot>
		</view>
		<view class="footer">
			<slot name="footer"></slot>
		</view>
		<view class="exemption">
			<view class="name">
				新疆旅游 · 官方助手
			</view>
			<view class="desc">
				游客体验自由自在 我们服务无处不在
			</view>
		</view>
		<view :style="'height:'+mb+'rpx'">

		</view>


	</view>
</template>

<script setup>
	import {
		ref,
		computed
	} from "vue"
	defineProps({
		loading: {
			type: Boolean,
			default: false
		},
		header: {
			type: Boolean,
			default: false
		},
		mb: {
			type: String,
			default: "0"
		}
	})
</script>

<style lang="scss">
	.loading {
		position: fixed;
		width: 100%;
		height: 100%;
		background: #f4f6fa;
		z-index: 99999999;

		@keyframes spin {
			0% {
				transform: rotate(0deg);
			}

			100% {
				transform: rotate(360deg);
			}
		}

		.loader {
			border: 6rpx solid #fff;
			border-top: 6rpx solid #f00;
			border-radius: 50%;
			width: 90rpx;
			height: 90rpx;
			animation: spin 2s linear infinite;
			position: absolute;
			left: calc(50% - 50rpx);
			top: calc(50% - 50rpx);
		}

		.avatar {
			background: url('');
			width: 80rpx;
			height: 80rpx;
			background-size: cover;
			background-color: #f00;
			border-radius: 50%;
			position: absolute;
			left: calc(50% - 40rpx);
			top: calc(50% - 40rpx);
		}
	}

	.container {
		overflow: hidden;
	}

	.exemption {
		padding: 30rpx;
		text-align: center;

		.name {
			color: var(--color);
			font-weight: bold;
			margin-bottom: 5rpx;
			font-family: Times New Roman, Times, serif;
			font-size: 32rpx;
		}

		.desc {
			font-size: 20rpx;
			color: #ccc;
		}
	}
</style>